import java.util.*;

public class _33define {
    public static void main(String[] args) {
        List<Stu> stus=generateStus();
        System.out.println(stus);
        Map<Level,ArrayList<Stu>> map=new HashMap<>();
        for (Stu stu : stus) {
            int score= stu.getScore();
            Level level=getLevel(score);
            ArrayList<Stu> students=map.getOrDefault(level,new ArrayList<Stu>());
            students.add(stu);
            map.put(level,students);
        }
        map.forEach((k,v)-> System.out.println(k+"---->"+v));
    }
    private static Level getLevel(int score){
        Level level=null;
        if (score<60){
            level=Level.BAD;
        } else if (score>=60&&score<80) {
            level=Level.GOOD;
        }else {
            level=Level.EXCELLENT;
        }
        return level;
    }
    public static List<Stu> generateStus(){
        ArrayList<Stu> students=new ArrayList<>();
        Random random=new Random();
        for (int i = 0; i < 50; i++) {
            Stu stu=new Stu(i+"---", random.nextInt(100)+1);
            students.add(stu);
        }
        return students;
    }
}
class Stu{
    String name;
    int score;

    public Stu(String name, int score) {
        this.name = name;
        this.score = score;
    }

    public String getName() {
        return name;
    }

    public int getScore() {
        return score;
    }

    @Override
    public String toString() {
        return "Stu{" +
                "name='" + name + '\'' +
                ", score=" + score +
                '}';
    }
}
enum Level{
    BAD,
    GOOD,
    EXCELLENT
}
